# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ruby-colorator
_gemname=colorator
pkgver=1.1.0
pkgrel=2
pkgdesc="Colorize your text in the terminal"
url="https://github.com/octopress/colorator"
arch="noarch"
license="MIT"
depends="ruby"
checkdepends="ruby-rspec"
source="https://github.com/octopress/colorator/archive/v$pkgver/$pkgname-$pkgver.tar.gz
	gemspec.patch
	remove-luna-rspec.patch
	"
builddir="$srcdir/$_gemname-$pkgver"

build() {
	gem build $_gemname.gemspec
}

check() {
	rspec .
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"
	local geminstdir="$gemdir/gems/$_gemname-$pkgver"

	gem install \
		--local \
		--install-dir "$gemdir" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		$_gemname

	# Remove unnecessary files and rubbish...
	cd "$gemdir"
	rm -r cache build_info doc extensions
}

sha512sums="
7bc2e85f8c4db8ca6db5140c9ebb471d3b1733c1c408595eb0bec531ec5f08fc86f4ee793a451bf51f359c8d4f07beac9e5ae9f418e2752be1c4fb0442b802de  ruby-colorator-1.1.0.tar.gz
1d15ac673140feeaa28924fa5072dc3a5619ff9550200ef674259ff80b68a7033a9c53c4b2bd3297cd0f24c15bcbde92c97cf59e5150478b67e885400e69e8bf  gemspec.patch
ea591a0d8d2bb72a39976641219630c52c435ed1e62c5ce883bacd84a02b9a23d61d9874e1ff1250587fde10326be8e5436cb64a6280a46d6168861de1094d23  remove-luna-rspec.patch
"
